package com.boot.ip;

import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @Author: lkz
 * @Title:
 * @Description: 高德
 * @Date: 2023/9/6 14:11
 */

public class GaoDeHttpAK {


    public static String URL = "https://restapi.amap.com/v3/ip";

    public static String Key = "dd85be677d5649fb0fe440ecb897e816";// 您的AK

    public static void main(String[] args) throws Exception {

        /**
         * 10000 正常
         * 10003 已超出日访问量
         * 10004 单位时间内访问频繁
         * 40002 购买服务到期
         * 40000 余额耗尽
         */

        Map params = new LinkedHashMap<String, String>();
        params.put("ip", "180.111.120.254");
        params.put("key", Key);

        String json = HttpUtil.get(URL, params);
        GaodeVo locationVO = JSON.parseObject(json, GaodeVo.class);
        System.out.println(locationVO);


    }


}


